package com.alks.entity.data.enums.biocontrol;

import lombok.Getter;

/**
 * @author MS
 * @since 2025/2/25 下午3:28
 */

@Getter
public enum StitchDeptEnum {
    /**
     * 针车组别格式变换
     */
    NEEDLE_1("本厂_针1组", "针一课1组"),
    NEEDLE_2("本厂_针2组", "针一课2组"),
    NEEDLE_3("本厂_针3组", "针一课3组"),
    NEEDLE_4("本厂_针4组", "针一课4组"),
    NEEDLE_5("本厂_针5组", "针一课5组"),
    NEEDLE_6("本厂_针6组", "针一课6组"),
    NEEDLE_7("本厂_针7组", "针二课7组"),
    NEEDLE_8("本厂_针8组", "针二课8组"),
    NEEDLE_9("本厂_针9组", "针二课9组"),
    NEEDLE_10("本厂_针10组", "针二课10组"),
    NEEDLE_11("本厂_针11组", "针二课11组"),
    NEEDLE_12("本厂_针12组", "针二课12组"),
    NEEDLE_13("本厂_针13组", "针三课13组"),
    NEEDLE_14("本厂_针14组", "针三课14组"),
    NEEDLE_15("本厂_针15组", "针三课15组"),
    NEEDLE_16("本厂_针16组", "针三课16组"),
    NEEDLE_17("本厂_针17组", "针三课17组"),
    NEEDLE_18("本厂_针18组", "针三课18组"),
    NEEDLE_19("本厂_针19组", "针四课19组"),
    NEEDLE_20("本厂_针20组", "针四课20组"),
    NEEDLE_21("本厂_针21组", "针四课21组"),
    NEEDLE_22("本厂_针22组", "针四课22组"),
    NEEDLE_23("本厂_针23组", "针四课23组"),
    NEEDLE_24("本厂_针24组", "针四课24组");

    private final String groupName;
    private final String lessonName;

    StitchDeptEnum(String groupName, String lessonName) {
        this.groupName = groupName;
        this.lessonName = lessonName;
    }

    public static String fromGroupName(String groupName) {
        for (StitchDeptEnum dept : values()) {
            if (dept.getGroupName().equals(groupName)) {
                return dept.lessonName;
            }
        }
        return groupName;
    }

    public static String fromLessonName(String lessonName) {
        for (StitchDeptEnum dept : values()) {
            if (dept.getLessonName().equals(lessonName)) {
                return dept.groupName;
            }
        }
        return lessonName;
    }
}
